/********************************************************
#include <conio.h>
#include <iostream>
using namespace std;
void nhap(int *p, int n)
{
	p= new int[n];
	if (p==NULL)
	{
		cout<<"\nloi cap phat";
		getch();
	}
	else
	{
		for (int i=0; i<n; i++)
		{
			cout<<"\nNhap p["<<i<<"]= ";
			cin>>p[i];
		}
	}
}

void in(int *p,int n)
{
	for (int i=0; i<n; i++)
	{
		cout<<p[i]<<" ";
	}
}

void hoanvi(int &a, int &b)
{
	int t=a;
	a=b;
	b=t;
}

void sapxep( int *p, int n)
{
	for (int i=0; i<n-1; i++)
	{
		for (int j=i+1; j<n; j++)
		{
			if (p[i]<p[j])
				hoanvi(p[i],p[j]);
		}
	}
}
void main()
{
	int n, *p = NULL;
	cout<<"Nhap n: ";
	cin>>n;
	nhap(p,n);
	cout<<"\nMang duoc nhap vao la: ";
	in(p, n);
	sapxep(p,n);
	cout<<"\nMang sau khi sap xep la: ";
	in(p,n);
	getch();
}
/********************************************************/